/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package tmgt;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 *
 * @author joel
 */
@Entity
@Table(name = "PROCESSINFO", catalog = "", schema = "ROOT")
@NamedQueries({@NamedQuery(name = "Processinfo.findAll", query = "SELECT p FROM Processinfo p"), @NamedQuery(name = "Processinfo.findByProcessid", query = "SELECT p FROM Processinfo p WHERE p.processid = :processid"), @NamedQuery(name = "Processinfo.findByName", query = "SELECT p FROM Processinfo p WHERE p.name = :name"), @NamedQuery(name = "Processinfo.findByDescription", query = "SELECT p FROM Processinfo p WHERE p.description = :description")})
public class Processinfo implements Serializable {
    @Transient
    private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "PROCESSID")
    private Long processid;
    @Column(name = "NAME")
    private String name;
    @Column(name = "DESCRIPTION")
    private String description;

    public Processinfo() {
    }

    public Processinfo(Long processid) {
        this.processid = processid;
    }

    public Long getProcessid() {
        return processid;
    }

    public void setProcessid(Long processid) {
        Long oldProcessid = this.processid;
        this.processid = processid;
        changeSupport.firePropertyChange("processid", oldProcessid, processid);
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        String oldName = this.name;
        this.name = name;
        changeSupport.firePropertyChange("name", oldName, name);
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        String oldDescription = this.description;
        this.description = description;
        changeSupport.firePropertyChange("description", oldDescription, description);
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (processid != null ? processid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Processinfo)) {
            return false;
        }
        Processinfo other = (Processinfo) object;
        if ((this.processid == null && other.processid != null) || (this.processid != null && !this.processid.equals(other.processid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "tmgt2.Processinfo[processid=" + processid + "]";
    }

    public void addPropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.removePropertyChangeListener(listener);
    }

}
